import * as Ee from "vue";
import { defineComponent as S, ref as rt, getCurrentInstance as V, computed as I, withDirectives as Ut, openBlock as h, createElementBlock as _, createElementVNode as w, normalizeStyle as B, vShow as Gt, onMounted as ot, resolveComponent as g, Fragment as M, renderList as L, createBlock as U, resolveDynamicComponent as Lt, normalizeClass as zt, createVNode as s, withCtx as c, createTextVNode as T, toDisplayString as Y, reactive as Dt, version as it } from "vue";
function Kt(e, t) {
  for (var n = 0; n < t.length; n++) {
    const a = t[n];
    if (typeof a != "string" && !Array.isArray(a)) {
      for (const r in a)
        if (r !== "default" && !(r in e)) {
          const l = Object.getOwnPropertyDescriptor(a, r);
          l && Object.defineProperty(e, r, l.get ? l : {
            enumerable: !0,
            get: () => a[r]
          });
        }
    }
  }
  return Object.freeze(Object.defineProperty(e, Symbol.toStringTag, { value: "Module" }));
}
var st = !1, lt = !0, kt = void 0;
function Ft() {
}
function Nt(e, t, n) {
  return Array.isArray(e) ? (e.length = Math.max(e.length, t), e.splice(t, 1, n), n) : (e[t] = n, n);
}
function Ht(e, t) {
  if (Array.isArray(e)) {
    e.splice(t, 1);
    return;
  }
  delete e[t];
}
const Wt = /* @__PURE__ */ Kt({
  __proto__: null,
  Vue: Ee,
  Vue2: kt,
  del: Ht,
  install: Ft,
  isVue2: st,
  isVue3: lt,
  set: Nt
}, [Ee]), O = (e) => e.appContext.config.globalProperties.$vptd;
const E = (e, t) => {
  const n = e.__vccOpts || e;
  for (const [a, r] of t)
    n[a] = r;
  return n;
}, Xt = S({
  name: "size-control",
  setup() {
    const e = rt(""), t = V(), n = O(t), a = I(() => n.state.type), r = I(() => {
      let u = n.state.activeElement;
      return u.resizable ? u : "";
    }), l = (u, p, m, v) => {
      var d, C;
      u.stopPropagation(), e.value = p, n.commit("initmove", {
        startX: u.pageX,
        startY: u.pageY,
        originX: (d = r.value) == null ? void 0 : d[m],
        originY: (C = r.value) == null ? void 0 : C[v]
      }), document.addEventListener("mousemove", o, !0), document.addEventListener("mouseup", i, !0);
    }, o = (u) => {
      u.stopPropagation(), u.preventDefault(), n.commit("resize", {
        x: u.pageX,
        y: u.pageY,
        type: e.value
      });
    }, i = () => {
      document.removeEventListener("mousemove", o, !0), document.removeEventListener("mouseup", i, !0), n.commit("stopmove");
    };
    return {
      optionsType: a,
      elm: r,
      typeRef: e,
      handlemousedown: l,
      handlemousemove: o,
      handlemouseup: i
    };
  }
}), Zt = /* @__PURE__ */ w("div", { class: "square" }, null, -1), Rt = [
  Zt
], Yt = /* @__PURE__ */ w("div", { class: "square" }, null, -1), xt = [
  Yt
], Jt = /* @__PURE__ */ w("div", { class: "square" }, null, -1), Qt = [
  Jt
], qt = /* @__PURE__ */ w("div", { class: "square" }, null, -1), en = [
  qt
];
function tn(e, t, n, a, r, l) {
  return Ut((h(), _("div", null, [
    w("div", {
      style: B({
        height: e.elm.height + "px",
        top: e.elm.top + "px",
        left: e.elm.left + "px"
      }),
      class: "verti",
      onMousedown: t[0] || (t[0] = (o) => e.handlemousedown(o, "left", "left", "width"))
    }, Rt, 36),
    w("div", {
      style: B({
        height: e.elm.height + "px",
        top: e.elm.top + "px",
        left: e.elm.left + e.elm.width + "px"
      }),
      class: "verti",
      onMousedown: t[1] || (t[1] = (o) => e.handlemousedown(o, "right", "width"))
    }, xt, 36),
    w("div", {
      style: B({
        width: e.elm.width + "px",
        top: e.elm.top + "px",
        left: e.elm.left + "px"
      }),
      class: "horiz",
      onMousedown: t[2] || (t[2] = (o) => e.handlemousedown(o, "up", "top", "height"))
    }, Qt, 36),
    w("div", {
      style: B({
        width: e.elm.width + "px",
        top: e.elm.top + e.elm.height + "px",
        left: e.elm.left + "px"
      }),
      class: "horiz",
      onMousedown: t[3] || (t[3] = (o) => e.handlemousedown(o, "down", "height"))
    }, en, 36)
  ], 512)), [
    [Gt, e.optionsType !== "page"]
  ]);
}
const nn = /* @__PURE__ */ E(Xt, [["render", tn]]);
function an(e, t) {
  function n(l) {
    e.commit("initmove", {
      startX: l.pageX,
      startY: l.pageY,
      originX: t.value.left,
      originY: t.value.top
    }), document.addEventListener("mousemove", a, !0), document.addEventListener("mouseup", r, !0);
  }
  function a(l) {
    l.stopPropagation(), l.preventDefault(), e.commit("move", {
      x: l.pageX,
      y: l.pageY
    });
  }
  function r() {
    document.removeEventListener("mousemove", a, !0), document.removeEventListener("mouseup", r, !0), e.commit("stopmove");
  }
  return {
    handlemouseup: r,
    handlemousemove: a,
    initmovement: n
  };
}
const rn = S({
  components: {
    control: nn
    // 尺寸控制
  },
  setup() {
    const e = V(), t = O(e), n = I(() => t.state.page), a = I(() => t.state.page.tempItems), r = I(() => t.state.uuid), l = I(() => t.state.page.imageUrl ? t.state.page.imageUrl : ""), o = I(() => t.state.activeElement), { initmovement: i } = an(t, o), u = (m) => {
      var v = p(m.target);
      if (v) {
        var d = v.getAttribute("data-uuid");
        t.commit("select", {
          uuid: d || -1
        }), v = o.value, v.dragable && i(m);
      } else
        t.commit("select", {
          uuid: -1
        });
    }, p = (m) => {
      let v = m.getAttribute("data-type");
      return v ? v === "viewport" ? !1 : m : p(m.parentNode);
    };
    return ot(() => {
      let m = document.getElementById("viewport");
      m ? m.addEventListener("mousedown", u, !1) : console.error("未找的‘viewport’节点"), document.addEventListener(
        "keydown",
        (v) => {
          v.stopPropagation();
          var d = o.value;
          if (v.keyCode === 37 && d.left) {
            d.left -= 1;
            return;
          }
          if (v.keyCode === 38 && d.top) {
            v.preventDefault(), d.top -= 1;
            return;
          }
          if (v.keyCode === 39 && d.left) {
            d.left += 1;
            return;
          }
          v.keyCode === 40 && d.top && (v.preventDefault(), d.top += 1);
        },
        !0
      );
    }), {
      page: n,
      widgetStore: a,
      widgetId: r,
      backImg: l,
      handleSelection: u,
      selectTarget: p
    };
  }
}), on = {
  id: "viewport",
  "data-type": "viewport",
  class: "holder"
};
function sn(e, t, n, a, r, l) {
  const o = g("control");
  return h(), _("div", on, [
    w("div", {
      style: B({
        height: e.page.height + "px",
        width: e.page.width + "px",
        backgroundImage: "url(" + e.backImg + ")"
      }),
      class: "screen"
    }, [
      (h(!0), _(M, null, L(e.widgetStore, (i) => (h(), U(Lt(i.type), {
        "data-title": i.type,
        class: zt([{ active: e.widgetId === i.uuid }, "layer"]),
        key: i.uuid,
        val: i,
        "data-type": i.type,
        "data-uuid": i.uuid,
        onChange: (u) => i.value = u
      }, null, 40, ["data-title", "class", "val", "data-type", "data-uuid", "onChange"]))), 128)),
      s(o)
    ], 4)
  ]);
}
const ln = /* @__PURE__ */ E(rn, [["render", sn]]), un = S({
  name: "page",
  components: {},
  setup() {
    const e = V(), t = O(e);
    return {
      pageInfo: I(() => t.state.page)
    };
  }
}), cn = /* @__PURE__ */ w("span", { class: "unit-text" }, "(mm)", -1), pn = /* @__PURE__ */ w("span", { class: "unit-text" }, "(mm)", -1);
function dn(e, t, n, a, r, l) {
  const o = g("el-input"), i = g("el-form-item"), u = g("el-row"), p = g("el-input-number"), m = g("el-col"), v = g("el-form");
  return h(), _("div", null, [
    s(v, {
      "label-width": "80px",
      model: e.pageInfo,
      size: "mini",
      class: "kr-form"
    }, {
      default: c(() => [
        s(u, null, {
          default: c(() => [
            s(i, { label: "模板名称" }, {
              default: c(() => [
                s(o, {
                  modelValue: e.pageInfo.title,
                  "onUpdate:modelValue": t[0] || (t[0] = (d) => e.pageInfo.title = d),
                  class: "full-w"
                }, null, 8, ["modelValue"])
              ]),
              _: 1
            })
          ]),
          _: 1
        }),
        s(u, null, {
          default: c(() => [
            s(m, { span: 12 }, {
              default: c(() => [
                s(i, { label: "模板宽度" }, {
                  default: c(() => [
                    s(p, {
                      modelValue: e.pageInfo.width,
                      "onUpdate:modelValue": t[1] || (t[1] = (d) => e.pageInfo.width = d),
                      "controls-position": "right",
                      min: 0,
                      class: "min-input"
                    }, null, 8, ["modelValue"])
                  ]),
                  _: 1
                })
              ]),
              _: 1
            }),
            s(m, { span: 12 }, {
              default: c(() => [
                s(i, { label: "模板高度" }, {
                  default: c(() => [
                    s(p, {
                      modelValue: e.pageInfo.height,
                      "onUpdate:modelValue": t[2] || (t[2] = (d) => e.pageInfo.height = d),
                      "controls-position": "right",
                      min: 0,
                      class: "min-input"
                    }, null, 8, ["modelValue"])
                  ]),
                  _: 1
                })
              ]),
              _: 1
            })
          ]),
          _: 1
        }),
        s(u, null, {
          default: c(() => [
            s(i, { label: "纸张宽度" }, {
              default: c(() => [
                s(p, {
                  modelValue: e.pageInfo.pageWidth,
                  "onUpdate:modelValue": t[3] || (t[3] = (d) => e.pageInfo.pageWidth = d),
                  "controls-position": "right",
                  min: 0,
                  class: "min-input"
                }, null, 8, ["modelValue"]),
                cn
              ]),
              _: 1
            })
          ]),
          _: 1
        }),
        s(u, null, {
          default: c(() => [
            s(i, { label: "纸张高度" }, {
              default: c(() => [
                s(p, {
                  modelValue: e.pageInfo.pageHeight,
                  "onUpdate:modelValue": t[4] || (t[4] = (d) => e.pageInfo.pageHeight = d),
                  "controls-position": "right",
                  min: 0,
                  class: "min-input"
                }, null, 8, ["modelValue"]),
                pn
              ]),
              _: 1
            })
          ]),
          _: 1
        })
      ]),
      _: 1
    }, 8, ["model"])
  ]);
}
const fn = /* @__PURE__ */ E(un, [["render", dn]]), x = () => ({
  uuid: "",
  type: "braid-txt",
  name: "",
  isEdit: !0,
  dragable: !0,
  // 是否可拖拽
  resizable: !0,
  // 尺寸是否可变
  width: 120,
  height: 40,
  left: 50,
  top: 0,
  value: "自定义文本",
  title: "自定义文本",
  defaultValue: "自定义文本",
  style: { zIndex: 1 }
}), vn = () => ["128A", "128B", "128C", "128Auto", "EAN8", "EAN13", "EAN128A", "EAN128B", "EAN128C", "Code39", "39Extended", "2_5interleaved", "2_5industrial", "2_5matrix", "UPC_A", "UPC_E0", "UPC_E1", "UPCsupp2", "UPCsupp5", "Code93", "93Extended", "MSI", "PostNet", "Codabar", "QRCode", "PDF417"], gn = () => [
  { label: "普通项", value: 0 },
  { label: "页眉页脚", value: 1 },
  { label: "页号项", value: 2 },
  { label: "页数项", value: 3 },
  { label: "多页项", value: 4 }
];
const mn = S({
  name: "appearance",
  components: {},
  setup() {
    const e = V(), t = O(e), n = I(() => t.state.activeElement);
    return {
      height: I(() => t.state.page.height),
      activeElement: n,
      codeTypeArray: vn(),
      itemTypeArray: gn()
    };
  }
});
function yn(e, t, n, a, r, l) {
  const o = g("el-input-number"), i = g("el-form-item"), u = g("el-col"), p = g("el-row"), m = g("el-switch"), v = g("el-color-picker"), d = g("el-radio"), C = g("el-radio-group"), $ = g("el-option"), N = g("el-select"), A = g("el-form");
  return h(), _("div", null, [
    s(A, {
      "label-width": "80px",
      model: e.activeElement,
      size: "mini",
      class: "kr-form"
    }, {
      default: c(() => [
        s(p, null, {
          default: c(() => [
            s(u, { span: 12 }, {
              default: c(() => [
                s(i, { label: "宽度" }, {
                  default: c(() => [
                    s(o, {
                      modelValue: e.activeElement.width,
                      "onUpdate:modelValue": t[0] || (t[0] = (f) => e.activeElement.width = f),
                      "controls-position": "right",
                      min: 1,
                      class: "min-input"
                    }, null, 8, ["modelValue"])
                  ]),
                  _: 1
                })
              ]),
              _: 1
            }),
            s(u, { span: 12 }, {
              default: c(() => [
                s(i, { label: "高度" }, {
                  default: c(() => [
                    s(o, {
                      modelValue: e.activeElement.height,
                      "onUpdate:modelValue": t[1] || (t[1] = (f) => e.activeElement.height = f),
                      "controls-position": "right",
                      min: 1,
                      class: "min-input"
                    }, null, 8, ["modelValue"])
                  ]),
                  _: 1
                })
              ]),
              _: 1
            })
          ]),
          _: 1
        }),
        s(p, null, {
          default: c(() => [
            s(u, { span: 12 }, {
              default: c(() => [
                s(i, { label: "横坐标" }, {
                  default: c(() => [
                    s(o, {
                      modelValue: e.activeElement.left,
                      "onUpdate:modelValue": t[2] || (t[2] = (f) => e.activeElement.left = f),
                      "controls-position": "right",
                      min: 0,
                      class: "min-input"
                    }, null, 8, ["modelValue"])
                  ]),
                  _: 1
                })
              ]),
              _: 1
            }),
            s(u, { span: 12 }, {
              default: c(() => [
                s(i, { label: "纵坐标" }, {
                  default: c(() => [
                    s(o, {
                      modelValue: e.activeElement.top,
                      "onUpdate:modelValue": t[3] || (t[3] = (f) => e.activeElement.top = f),
                      "controls-position": "right",
                      min: 0,
                      class: "min-input"
                    }, null, 8, ["modelValue"])
                  ]),
                  _: 1
                })
              ]),
              _: 1
            })
          ]),
          _: 1
        }),
        s(p, null, {
          default: c(() => [
            s(u, { span: 12 }, {
              default: c(() => [
                s(i, { label: "字号" }, {
                  default: c(() => [
                    s(o, {
                      disabled: e.activeElement.style.FontSize === void 0,
                      modelValue: e.activeElement.style.FontSize,
                      "onUpdate:modelValue": t[4] || (t[4] = (f) => e.activeElement.style.FontSize = f),
                      "controls-position": "right",
                      min: 0,
                      class: "min-input"
                    }, null, 8, ["disabled", "modelValue"])
                  ]),
                  _: 1
                })
              ]),
              _: 1
            }),
            s(u, { span: 12 }, {
              default: c(() => [
                s(i, { label: "加粗" }, {
                  default: c(() => [
                    s(m, {
                      disabled: e.activeElement.style.Bold === void 0,
                      modelValue: e.activeElement.style.Bold,
                      "onUpdate:modelValue": t[5] || (t[5] = (f) => e.activeElement.style.Bold = f),
                      "active-value": !0,
                      "inactive-value": !1
                    }, null, 8, ["disabled", "modelValue"])
                  ]),
                  _: 1
                })
              ]),
              _: 1
            })
          ]),
          _: 1
        }),
        s(p, null, {
          default: c(() => [
            s(u, { span: 8 }, {
              default: c(() => [
                s(i, { label: "字体颜色" }, {
                  default: c(() => [
                    s(v, {
                      disabled: e.activeElement.style.FontColor === void 0,
                      modelValue: e.activeElement.style.FontColor,
                      "onUpdate:modelValue": t[6] || (t[6] = (f) => e.activeElement.style.FontColor = f)
                    }, null, 8, ["disabled", "modelValue"])
                  ]),
                  _: 1
                })
              ]),
              _: 1
            }),
            s(u, { span: 8 }, {
              default: c(() => [
                s(i, { label: "边框颜色" }, {
                  default: c(() => [
                    s(v, {
                      disabled: e.activeElement.style.BorderColor === void 0,
                      modelValue: e.activeElement.style.BorderColor,
                      "onUpdate:modelValue": t[7] || (t[7] = (f) => e.activeElement.style.BorderColor = f)
                    }, null, 8, ["disabled", "modelValue"])
                  ]),
                  _: 1
                })
              ]),
              _: 1
            }),
            s(u, { span: 8 }, {
              default: c(() => [
                s(i, { label: "条码值" }, {
                  default: c(() => [
                    s(m, {
                      disabled: e.activeElement.style.ShowBarText === void 0,
                      modelValue: e.activeElement.style.ShowBarText,
                      "onUpdate:modelValue": t[8] || (t[8] = (f) => e.activeElement.style.ShowBarText = f),
                      "active-value": !0,
                      "inactive-value": !1
                    }, null, 8, ["disabled", "modelValue"])
                  ]),
                  _: 1
                })
              ]),
              _: 1
            })
          ]),
          _: 1
        }),
        s(p, null, {
          default: c(() => [
            s(i, { label: "对齐方式" }, {
              default: c(() => [
                s(C, {
                  disabled: e.activeElement.style.Alignment === void 0,
                  modelValue: e.activeElement.style.Alignment,
                  "onUpdate:modelValue": t[9] || (t[9] = (f) => e.activeElement.style.Alignment = f)
                }, {
                  default: c(() => [
                    s(d, { label: "left" }, {
                      default: c(() => [
                        T("左对齐")
                      ]),
                      _: 1
                    }),
                    s(d, { label: "center" }, {
                      default: c(() => [
                        T("居中")
                      ]),
                      _: 1
                    }),
                    s(d, { label: "right" }, {
                      default: c(() => [
                        T("右对齐")
                      ]),
                      _: 1
                    })
                  ]),
                  _: 1
                }, 8, ["disabled", "modelValue"])
              ]),
              _: 1
            })
          ]),
          _: 1
        }),
        s(p, null, {
          default: c(() => [
            s(u, { span: 12 }, {
              default: c(() => [
                s(i, { label: "条码类型" }, {
                  default: c(() => [
                    s(N, {
                      disabled: e.activeElement.style.codeType === void 0,
                      modelValue: e.activeElement.style.codeType,
                      "onUpdate:modelValue": t[10] || (t[10] = (f) => e.activeElement.style.codeType = f),
                      class: "min-input"
                    }, {
                      default: c(() => [
                        (h(!0), _(M, null, L(e.codeTypeArray, (f) => (h(), U($, {
                          key: f,
                          label: f,
                          value: f
                        }, null, 8, ["label", "value"]))), 128))
                      ]),
                      _: 1
                    }, 8, ["disabled", "modelValue"])
                  ]),
                  _: 1
                })
              ]),
              _: 1
            }),
            s(u, { span: 12 }, {
              default: c(() => [
                s(i, { label: "打印类型" }, {
                  default: c(() => [
                    s(N, {
                      disabled: e.activeElement.style.ItemType === void 0,
                      modelValue: e.activeElement.style.ItemType,
                      "onUpdate:modelValue": t[11] || (t[11] = (f) => e.activeElement.style.ItemType = f),
                      class: "min-input"
                    }, {
                      default: c(() => [
                        (h(!0), _(M, null, L(e.itemTypeArray, (f) => (h(), U($, {
                          key: f.value,
                          label: f.label,
                          value: f.value
                        }, null, 8, ["label", "value"]))), 128))
                      ]),
                      _: 1
                    }, 8, ["disabled", "modelValue"])
                  ]),
                  _: 1
                })
              ]),
              _: 1
            }),
            s(u, { span: 12 }, {
              default: c(() => [
                s(i, { label: "高度自动" }, {
                  default: c(() => [
                    s(m, {
                      disabled: e.activeElement.style.AutoHeight === void 0,
                      modelValue: e.activeElement.style.AutoHeight,
                      "onUpdate:modelValue": t[12] || (t[12] = (f) => e.activeElement.style.AutoHeight = f),
                      "active-value": !0,
                      "inactive-value": !1
                    }, null, 8, ["disabled", "modelValue"])
                  ]),
                  _: 1
                })
              ]),
              _: 1
            }),
            s(u, { span: 12 }, {
              default: c(() => [
                s(i, { label: "下边距" }, {
                  default: c(() => [
                    s(o, {
                      disabled: e.activeElement.style.BottomMargin === void 0 || !e.activeElement.style.AutoHeight,
                      modelValue: e.activeElement.style.BottomMargin,
                      "onUpdate:modelValue": t[13] || (t[13] = (f) => e.activeElement.style.BottomMargin = f),
                      "controls-position": "right",
                      min: 0,
                      class: "min-input"
                    }, null, 8, ["disabled", "modelValue"])
                  ]),
                  _: 1
                })
              ]),
              _: 1
            })
          ]),
          _: 1
        })
      ]),
      _: 1
    }, 8, ["model"])
  ]);
}
const bn = /* @__PURE__ */ E(mn, [["render", yn]]);
const hn = S({
  name: "options",
  components: {},
  setup() {
    const e = V(), t = O(e), n = rt(!1);
    return {
      optionItems: I(() => {
        var l;
        return (l = t.state) == null ? void 0 : l.optionItems;
      }),
      tablePopover: n,
      addTempItem: (l, o) => {
        switch (o.type) {
          case "braid-table": {
            let i = [];
            o.selectCol.forEach((u) => {
              let p = o.columnsAttr.find((m) => m.name === u);
              p && i.push(p);
            }), o.columns = i, t.dispatch("addTempItem", o), n.value = !1;
            break;
          }
          default:
            t.dispatch("addTempItem", o);
        }
      }
    };
  }
}), _n = { class: "options-box" };
function $n(e, t, n, a, r, l) {
  const o = g("el-checkbox"), i = g("el-col"), u = g("el-row"), p = g("el-checkbox-group"), m = g("el-button"), v = g("el-popover");
  return h(), _("div", _n, [
    (h(!0), _(M, null, L(e.optionItems, (d, C) => (h(), _(M, null, [
      d.type == "braid-table" ? (h(), U(v, {
        key: C,
        placement: "top",
        width: "200",
        modelValue: e.tablePopover,
        "onUpdate:modelValue": t[0] || (t[0] = ($) => e.tablePopover = $)
      }, {
        default: c(() => [
          w("div", null, [
            s(p, {
              modelValue: d.selectCol,
              "onUpdate:modelValue": ($) => d.selectCol = $
            }, {
              default: c(() => [
                s(u, null, {
                  default: c(() => [
                    (h(!0), _(M, null, L(d.columnsAttr, ($) => (h(), U(i, {
                      key: $.name,
                      span: 12
                    }, {
                      default: c(() => [
                        s(o, {
                          label: $.name
                        }, {
                          default: c(() => [
                            T(Y($.title), 1)
                          ]),
                          _: 2
                        }, 1032, ["label"])
                      ]),
                      _: 2
                    }, 1024))), 128))
                  ]),
                  _: 2
                }, 1024)
              ]),
              _: 2
            }, 1032, ["modelValue", "onUpdate:modelValue"]),
            s(m, {
              size: "mini",
              type: "primary",
              onClick: ($) => {
                e.addTempItem($, d);
              }
            }, {
              default: c(() => [
                T("确定")
              ]),
              _: 2
            }, 1032, ["onClick"])
          ]),
          s(m, {
            size: "mini",
            slot: "reference"
          }, {
            default: c(() => [
              T(Y(d.title), 1)
            ]),
            _: 2
          }, 1024)
        ]),
        _: 2
      }, 1032, ["modelValue"])) : (h(), U(m, {
        size: "mini",
        key: C + "-ele",
        onClick: ($) => {
          e.addTempItem($, d);
        }
      }, {
        default: c(() => [
          T(Y(d.title), 1)
        ]),
        _: 2
      }, 1032, ["onClick"]))
    ], 64))), 256))
  ]);
}
const wn = /* @__PURE__ */ E(hn, [["render", $n]]);
const In = S({
  name: "layers",
  setup() {
    const e = V(), t = O(e), n = I(() => t.state.page.tempItems), a = I(() => t.state.activeElement);
    return {
      layers: n,
      activeElement: a
    };
  }
}), Cn = { class: "tag-box" };
function An(e, t, n, a, r, l) {
  const o = g("el-tag");
  return h(), _("div", Cn, [
    (h(!0), _(M, null, L(e.layers, (i, u) => (h(), U(o, {
      key: u,
      closable: i === e.activeElement,
      size: "small",
      type: i === e.activeElement ? "" : "info",
      onClick: (p) => {
        e.activeLayer(p, i);
      },
      onClose: (p) => {
        e.dele(p, i);
      }
    }, {
      default: c(() => [
        T(Y(i.title), 1)
      ]),
      _: 2
    }, 1032, ["closable", "type", "onClick", "onClose"]))), 128))
  ]);
}
const Tn = /* @__PURE__ */ E(In, [["render", An]]), Sn = S({
  name: "panel",
  components: {
    page: fn,
    appearance: bn,
    options: wn,
    layers: Tn
  },
  setup() {
    return {
      activeNames: ["1", "2", "3", "4"]
    };
  }
}), En = { class: "kr-collapse" };
function jn(e, t, n, a, r, l) {
  const o = g("page"), i = g("el-collapse-item"), u = g("appearance"), p = g("options"), m = g("layers"), v = g("el-collapse");
  return h(), _("div", En, [
    s(v, {
      modelValue: e.activeNames,
      "onUpdate:modelValue": t[0] || (t[0] = (d) => e.activeNames = d)
    }, {
      default: c(() => [
        s(i, {
          title: "页面参数",
          name: "1"
        }, {
          default: c(() => [
            s(o)
          ]),
          _: 1
        }),
        s(i, {
          title: "样式",
          name: "2"
        }, {
          default: c(() => [
            s(u, { class: "pd-l-10" })
          ]),
          _: 1
        }),
        s(i, {
          title: "组件",
          name: "3"
        }, {
          default: c(() => [
            s(p)
          ]),
          _: 1
        }),
        s(i, {
          title: "已加组件",
          name: "4"
        }, {
          default: c(() => [
            s(m)
          ]),
          _: 1
        })
      ]),
      _: 1
    }, 8, ["modelValue"])
  ]);
}
const Vn = /* @__PURE__ */ E(Sn, [["render", jn]]);
var Z = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
function ut(e) {
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
}
function On() {
  this.__data__ = [], this.size = 0;
}
var Bn = On;
function Pn(e, t) {
  return e === t || e !== e && t !== t;
}
var ct = Pn, Mn = ct;
function Un(e, t) {
  for (var n = e.length; n--; )
    if (Mn(e[n][0], t))
      return n;
  return -1;
}
var ae = Un, Gn = ae, Ln = Array.prototype, zn = Ln.splice;
function Dn(e) {
  var t = this.__data__, n = Gn(t, e);
  if (n < 0)
    return !1;
  var a = t.length - 1;
  return n == a ? t.pop() : zn.call(t, n, 1), --this.size, !0;
}
var Kn = Dn, kn = ae;
function Fn(e) {
  var t = this.__data__, n = kn(t, e);
  return n < 0 ? void 0 : t[n][1];
}
var Nn = Fn, Hn = ae;
function Wn(e) {
  return Hn(this.__data__, e) > -1;
}
var Xn = Wn, Zn = ae;
function Rn(e, t) {
  var n = this.__data__, a = Zn(n, e);
  return a < 0 ? (++this.size, n.push([e, t])) : n[a][1] = t, this;
}
var Yn = Rn, xn = Bn, Jn = Kn, Qn = Nn, qn = Xn, ea = Yn;
function z(e) {
  var t = -1, n = e == null ? 0 : e.length;
  for (this.clear(); ++t < n; ) {
    var a = e[t];
    this.set(a[0], a[1]);
  }
}
z.prototype.clear = xn;
z.prototype.delete = Jn;
z.prototype.get = Qn;
z.prototype.has = qn;
z.prototype.set = ea;
var re = z, ta = re;
function na() {
  this.__data__ = new ta(), this.size = 0;
}
var aa = na;
function ra(e) {
  var t = this.__data__, n = t.delete(e);
  return this.size = t.size, n;
}
var oa = ra;
function ia(e) {
  return this.__data__.get(e);
}
var sa = ia;
function la(e) {
  return this.__data__.has(e);
}
var ua = la, ca = typeof Z == "object" && Z && Z.Object === Object && Z, pt = ca, pa = pt, da = typeof self == "object" && self && self.Object === Object && self, fa = pa || da || Function("return this")(), j = fa, va = j, ga = va.Symbol, ye = ga, je = ye, dt = Object.prototype, ma = dt.hasOwnProperty, ya = dt.toString, H = je ? je.toStringTag : void 0;
function ba(e) {
  var t = ma.call(e, H), n = e[H];
  try {
    e[H] = void 0;
    var a = !0;
  } catch {
  }
  var r = ya.call(e);
  return a && (t ? e[H] = n : delete e[H]), r;
}
var ha = ba, _a = Object.prototype, $a = _a.toString;
function wa(e) {
  return $a.call(e);
}
var Ia = wa, Ve = ye, Ca = ha, Aa = Ia, Ta = "[object Null]", Sa = "[object Undefined]", Oe = Ve ? Ve.toStringTag : void 0;
function Ea(e) {
  return e == null ? e === void 0 ? Sa : Ta : Oe && Oe in Object(e) ? Ca(e) : Aa(e);
}
var oe = Ea;
function ja(e) {
  var t = typeof e;
  return e != null && (t == "object" || t == "function");
}
var W = ja, Va = oe, Oa = W, Ba = "[object AsyncFunction]", Pa = "[object Function]", Ma = "[object GeneratorFunction]", Ua = "[object Proxy]";
function Ga(e) {
  if (!Oa(e))
    return !1;
  var t = Va(e);
  return t == Pa || t == Ma || t == Ba || t == Ua;
}
var ft = Ga, La = j, za = La["__core-js_shared__"], Da = za, ue = Da, Be = function() {
  var e = /[^.]+$/.exec(ue && ue.keys && ue.keys.IE_PROTO || "");
  return e ? "Symbol(src)_1." + e : "";
}();
function Ka(e) {
  return !!Be && Be in e;
}
var ka = Ka, Fa = Function.prototype, Na = Fa.toString;
function Ha(e) {
  if (e != null) {
    try {
      return Na.call(e);
    } catch {
    }
    try {
      return e + "";
    } catch {
    }
  }
  return "";
}
var vt = Ha, Wa = ft, Xa = ka, Za = W, Ra = vt, Ya = /[\\^$.*+?()[\]{}|]/g, xa = /^\[object .+?Constructor\]$/, Ja = Function.prototype, Qa = Object.prototype, qa = Ja.toString, er = Qa.hasOwnProperty, tr = RegExp(
  "^" + qa.call(er).replace(Ya, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
);
function nr(e) {
  if (!Za(e) || Xa(e))
    return !1;
  var t = Wa(e) ? tr : xa;
  return t.test(Ra(e));
}
var ar = nr;
function rr(e, t) {
  return e == null ? void 0 : e[t];
}
var or = rr, ir = ar, sr = or;
function lr(e, t) {
  var n = sr(e, t);
  return ir(n) ? n : void 0;
}
var G = lr, ur = G, cr = j, pr = ur(cr, "Map"), be = pr, dr = G, fr = dr(Object, "create"), ie = fr, Pe = ie;
function vr() {
  this.__data__ = Pe ? Pe(null) : {}, this.size = 0;
}
var gr = vr;
function mr(e) {
  var t = this.has(e) && delete this.__data__[e];
  return this.size -= t ? 1 : 0, t;
}
var yr = mr, br = ie, hr = "__lodash_hash_undefined__", _r = Object.prototype, $r = _r.hasOwnProperty;
function wr(e) {
  var t = this.__data__;
  if (br) {
    var n = t[e];
    return n === hr ? void 0 : n;
  }
  return $r.call(t, e) ? t[e] : void 0;
}
var Ir = wr, Cr = ie, Ar = Object.prototype, Tr = Ar.hasOwnProperty;
function Sr(e) {
  var t = this.__data__;
  return Cr ? t[e] !== void 0 : Tr.call(t, e);
}
var Er = Sr, jr = ie, Vr = "__lodash_hash_undefined__";
function Or(e, t) {
  var n = this.__data__;
  return this.size += this.has(e) ? 0 : 1, n[e] = jr && t === void 0 ? Vr : t, this;
}
var Br = Or, Pr = gr, Mr = yr, Ur = Ir, Gr = Er, Lr = Br;
function D(e) {
  var t = -1, n = e == null ? 0 : e.length;
  for (this.clear(); ++t < n; ) {
    var a = e[t];
    this.set(a[0], a[1]);
  }
}
D.prototype.clear = Pr;
D.prototype.delete = Mr;
D.prototype.get = Ur;
D.prototype.has = Gr;
D.prototype.set = Lr;
var zr = D, Me = zr, Dr = re, Kr = be;
function kr() {
  this.size = 0, this.__data__ = {
    hash: new Me(),
    map: new (Kr || Dr)(),
    string: new Me()
  };
}
var Fr = kr;
function Nr(e) {
  var t = typeof e;
  return t == "string" || t == "number" || t == "symbol" || t == "boolean" ? e !== "__proto__" : e === null;
}
var Hr = Nr, Wr = Hr;
function Xr(e, t) {
  var n = e.__data__;
  return Wr(t) ? n[typeof t == "string" ? "string" : "hash"] : n.map;
}
var se = Xr, Zr = se;
function Rr(e) {
  var t = Zr(this, e).delete(e);
  return this.size -= t ? 1 : 0, t;
}
var Yr = Rr, xr = se;
function Jr(e) {
  return xr(this, e).get(e);
}
var Qr = Jr, qr = se;
function eo(e) {
  return qr(this, e).has(e);
}
var to = eo, no = se;
function ao(e, t) {
  var n = no(this, e), a = n.size;
  return n.set(e, t), this.size += n.size == a ? 0 : 1, this;
}
var ro = ao, oo = Fr, io = Yr, so = Qr, lo = to, uo = ro;
function K(e) {
  var t = -1, n = e == null ? 0 : e.length;
  for (this.clear(); ++t < n; ) {
    var a = e[t];
    this.set(a[0], a[1]);
  }
}
K.prototype.clear = oo;
K.prototype.delete = io;
K.prototype.get = so;
K.prototype.has = lo;
K.prototype.set = uo;
var co = K, po = re, fo = be, vo = co, go = 200;
function mo(e, t) {
  var n = this.__data__;
  if (n instanceof po) {
    var a = n.__data__;
    if (!fo || a.length < go - 1)
      return a.push([e, t]), this.size = ++n.size, this;
    n = this.__data__ = new vo(a);
  }
  return n.set(e, t), this.size = n.size, this;
}
var yo = mo, bo = re, ho = aa, _o = oa, $o = sa, wo = ua, Io = yo;
function k(e) {
  var t = this.__data__ = new bo(e);
  this.size = t.size;
}
k.prototype.clear = ho;
k.prototype.delete = _o;
k.prototype.get = $o;
k.prototype.has = wo;
k.prototype.set = Io;
var Co = k;
function Ao(e, t) {
  for (var n = -1, a = e == null ? 0 : e.length; ++n < a && t(e[n], n, e) !== !1; )
    ;
  return e;
}
var To = Ao, So = G, Eo = function() {
  try {
    var e = So(Object, "defineProperty");
    return e({}, "", {}), e;
  } catch {
  }
}(), jo = Eo, Ue = jo;
function Vo(e, t, n) {
  t == "__proto__" && Ue ? Ue(e, t, {
    configurable: !0,
    enumerable: !0,
    value: n,
    writable: !0
  }) : e[t] = n;
}
var gt = Vo, Oo = gt, Bo = ct, Po = Object.prototype, Mo = Po.hasOwnProperty;
function Uo(e, t, n) {
  var a = e[t];
  (!(Mo.call(e, t) && Bo(a, n)) || n === void 0 && !(t in e)) && Oo(e, t, n);
}
var mt = Uo, Go = mt, Lo = gt;
function zo(e, t, n, a) {
  var r = !n;
  n || (n = {});
  for (var l = -1, o = t.length; ++l < o; ) {
    var i = t[l], u = a ? a(n[i], e[i], i, n, e) : void 0;
    u === void 0 && (u = e[i]), r ? Lo(n, i, u) : Go(n, i, u);
  }
  return n;
}
var le = zo;
function Do(e, t) {
  for (var n = -1, a = Array(e); ++n < e; )
    a[n] = t(n);
  return a;
}
var Ko = Do;
function ko(e) {
  return e != null && typeof e == "object";
}
var X = ko, Fo = oe, No = X, Ho = "[object Arguments]";
function Wo(e) {
  return No(e) && Fo(e) == Ho;
}
var Xo = Wo, Ge = Xo, Zo = X, yt = Object.prototype, Ro = yt.hasOwnProperty, Yo = yt.propertyIsEnumerable, xo = Ge(function() {
  return arguments;
}()) ? Ge : function(e) {
  return Zo(e) && Ro.call(e, "callee") && !Yo.call(e, "callee");
}, Jo = xo, Qo = Array.isArray, he = Qo, Q = { exports: {} };
function qo() {
  return !1;
}
var ei = qo;
Q.exports;
(function(e, t) {
  var n = j, a = ei, r = t && !t.nodeType && t, l = r && !0 && e && !e.nodeType && e, o = l && l.exports === r, i = o ? n.Buffer : void 0, u = i ? i.isBuffer : void 0, p = u || a;
  e.exports = p;
})(Q, Q.exports);
var bt = Q.exports, ti = 9007199254740991, ni = /^(?:0|[1-9]\d*)$/;
function ai(e, t) {
  var n = typeof e;
  return t = t ?? ti, !!t && (n == "number" || n != "symbol" && ni.test(e)) && e > -1 && e % 1 == 0 && e < t;
}
var ri = ai, oi = 9007199254740991;
function ii(e) {
  return typeof e == "number" && e > -1 && e % 1 == 0 && e <= oi;
}
var ht = ii, si = oe, li = ht, ui = X, ci = "[object Arguments]", pi = "[object Array]", di = "[object Boolean]", fi = "[object Date]", vi = "[object Error]", gi = "[object Function]", mi = "[object Map]", yi = "[object Number]", bi = "[object Object]", hi = "[object RegExp]", _i = "[object Set]", $i = "[object String]", wi = "[object WeakMap]", Ii = "[object ArrayBuffer]", Ci = "[object DataView]", Ai = "[object Float32Array]", Ti = "[object Float64Array]", Si = "[object Int8Array]", Ei = "[object Int16Array]", ji = "[object Int32Array]", Vi = "[object Uint8Array]", Oi = "[object Uint8ClampedArray]", Bi = "[object Uint16Array]", Pi = "[object Uint32Array]", b = {};
b[Ai] = b[Ti] = b[Si] = b[Ei] = b[ji] = b[Vi] = b[Oi] = b[Bi] = b[Pi] = !0;
b[ci] = b[pi] = b[Ii] = b[di] = b[Ci] = b[fi] = b[vi] = b[gi] = b[mi] = b[yi] = b[bi] = b[hi] = b[_i] = b[$i] = b[wi] = !1;
function Mi(e) {
  return ui(e) && li(e.length) && !!b[si(e)];
}
var Ui = Mi;
function Gi(e) {
  return function(t) {
    return e(t);
  };
}
var _e = Gi, q = { exports: {} };
q.exports;
(function(e, t) {
  var n = pt, a = t && !t.nodeType && t, r = a && !0 && e && !e.nodeType && e, l = r && r.exports === a, o = l && n.process, i = function() {
    try {
      var u = r && r.require && r.require("util").types;
      return u || o && o.binding && o.binding("util");
    } catch {
    }
  }();
  e.exports = i;
})(q, q.exports);
var $e = q.exports, Li = Ui, zi = _e, Le = $e, ze = Le && Le.isTypedArray, Di = ze ? zi(ze) : Li, Ki = Di, ki = Ko, Fi = Jo, Ni = he, Hi = bt, Wi = ri, Xi = Ki, Zi = Object.prototype, Ri = Zi.hasOwnProperty;
function Yi(e, t) {
  var n = Ni(e), a = !n && Fi(e), r = !n && !a && Hi(e), l = !n && !a && !r && Xi(e), o = n || a || r || l, i = o ? ki(e.length, String) : [], u = i.length;
  for (var p in e)
    (t || Ri.call(e, p)) && !(o && // Safari 9 has enumerable `arguments.length` in strict mode.
    (p == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
    r && (p == "offset" || p == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
    l && (p == "buffer" || p == "byteLength" || p == "byteOffset") || // Skip index properties.
    Wi(p, u))) && i.push(p);
  return i;
}
var _t = Yi, xi = Object.prototype;
function Ji(e) {
  var t = e && e.constructor, n = typeof t == "function" && t.prototype || xi;
  return e === n;
}
var we = Ji;
function Qi(e, t) {
  return function(n) {
    return e(t(n));
  };
}
var $t = Qi, qi = $t, es = qi(Object.keys, Object), ts = es, ns = we, as = ts, rs = Object.prototype, os = rs.hasOwnProperty;
function is(e) {
  if (!ns(e))
    return as(e);
  var t = [];
  for (var n in Object(e))
    os.call(e, n) && n != "constructor" && t.push(n);
  return t;
}
var ss = is, ls = ft, us = ht;
function cs(e) {
  return e != null && us(e.length) && !ls(e);
}
var wt = cs, ps = _t, ds = ss, fs = wt;
function vs(e) {
  return fs(e) ? ps(e) : ds(e);
}
var Ie = vs, gs = le, ms = Ie;
function ys(e, t) {
  return e && gs(t, ms(t), e);
}
var bs = ys;
function hs(e) {
  var t = [];
  if (e != null)
    for (var n in Object(e))
      t.push(n);
  return t;
}
var _s = hs, $s = W, ws = we, Is = _s, Cs = Object.prototype, As = Cs.hasOwnProperty;
function Ts(e) {
  if (!$s(e))
    return Is(e);
  var t = ws(e), n = [];
  for (var a in e)
    a == "constructor" && (t || !As.call(e, a)) || n.push(a);
  return n;
}
var Ss = Ts, Es = _t, js = Ss, Vs = wt;
function Os(e) {
  return Vs(e) ? Es(e, !0) : js(e);
}
var Ce = Os, Bs = le, Ps = Ce;
function Ms(e, t) {
  return e && Bs(t, Ps(t), e);
}
var Us = Ms, ee = { exports: {} };
ee.exports;
(function(e, t) {
  var n = j, a = t && !t.nodeType && t, r = a && !0 && e && !e.nodeType && e, l = r && r.exports === a, o = l ? n.Buffer : void 0, i = o ? o.allocUnsafe : void 0;
  function u(p, m) {
    if (m)
      return p.slice();
    var v = p.length, d = i ? i(v) : new p.constructor(v);
    return p.copy(d), d;
  }
  e.exports = u;
})(ee, ee.exports);
var Gs = ee.exports;
function Ls(e, t) {
  var n = -1, a = e.length;
  for (t || (t = Array(a)); ++n < a; )
    t[n] = e[n];
  return t;
}
var zs = Ls;
function Ds(e, t) {
  for (var n = -1, a = e == null ? 0 : e.length, r = 0, l = []; ++n < a; ) {
    var o = e[n];
    t(o, n, e) && (l[r++] = o);
  }
  return l;
}
var Ks = Ds;
function ks() {
  return [];
}
var It = ks, Fs = Ks, Ns = It, Hs = Object.prototype, Ws = Hs.propertyIsEnumerable, De = Object.getOwnPropertySymbols, Xs = De ? function(e) {
  return e == null ? [] : (e = Object(e), Fs(De(e), function(t) {
    return Ws.call(e, t);
  }));
} : Ns, Ae = Xs, Zs = le, Rs = Ae;
function Ys(e, t) {
  return Zs(e, Rs(e), t);
}
var xs = Ys;
function Js(e, t) {
  for (var n = -1, a = t.length, r = e.length; ++n < a; )
    e[r + n] = t[n];
  return e;
}
var Ct = Js, Qs = $t, qs = Qs(Object.getPrototypeOf, Object), At = qs, el = Ct, tl = At, nl = Ae, al = It, rl = Object.getOwnPropertySymbols, ol = rl ? function(e) {
  for (var t = []; e; )
    el(t, nl(e)), e = tl(e);
  return t;
} : al, Tt = ol, il = le, sl = Tt;
function ll(e, t) {
  return il(e, sl(e), t);
}
var ul = ll, cl = Ct, pl = he;
function dl(e, t, n) {
  var a = t(e);
  return pl(e) ? a : cl(a, n(e));
}
var St = dl, fl = St, vl = Ae, gl = Ie;
function ml(e) {
  return fl(e, gl, vl);
}
var yl = ml, bl = St, hl = Tt, _l = Ce;
function $l(e) {
  return bl(e, _l, hl);
}
var wl = $l, Il = G, Cl = j, Al = Il(Cl, "DataView"), Tl = Al, Sl = G, El = j, jl = Sl(El, "Promise"), Vl = jl, Ol = G, Bl = j, Pl = Ol(Bl, "Set"), Ml = Pl, Ul = G, Gl = j, Ll = Ul(Gl, "WeakMap"), zl = Ll, de = Tl, fe = be, ve = Vl, ge = Ml, me = zl, Et = oe, F = vt, Ke = "[object Map]", Dl = "[object Object]", ke = "[object Promise]", Fe = "[object Set]", Ne = "[object WeakMap]", He = "[object DataView]", Kl = F(de), kl = F(fe), Fl = F(ve), Nl = F(ge), Hl = F(me), P = Et;
(de && P(new de(new ArrayBuffer(1))) != He || fe && P(new fe()) != Ke || ve && P(ve.resolve()) != ke || ge && P(new ge()) != Fe || me && P(new me()) != Ne) && (P = function(e) {
  var t = Et(e), n = t == Dl ? e.constructor : void 0, a = n ? F(n) : "";
  if (a)
    switch (a) {
      case Kl:
        return He;
      case kl:
        return Ke;
      case Fl:
        return ke;
      case Nl:
        return Fe;
      case Hl:
        return Ne;
    }
  return t;
});
var Te = P, Wl = Object.prototype, Xl = Wl.hasOwnProperty;
function Zl(e) {
  var t = e.length, n = new e.constructor(t);
  return t && typeof e[0] == "string" && Xl.call(e, "index") && (n.index = e.index, n.input = e.input), n;
}
var Rl = Zl, Yl = j, xl = Yl.Uint8Array, Jl = xl, We = Jl;
function Ql(e) {
  var t = new e.constructor(e.byteLength);
  return new We(t).set(new We(e)), t;
}
var Se = Ql, ql = Se;
function eu(e, t) {
  var n = t ? ql(e.buffer) : e.buffer;
  return new e.constructor(n, e.byteOffset, e.byteLength);
}
var tu = eu, nu = /\w*$/;
function au(e) {
  var t = new e.constructor(e.source, nu.exec(e));
  return t.lastIndex = e.lastIndex, t;
}
var ru = au, Xe = ye, Ze = Xe ? Xe.prototype : void 0, Re = Ze ? Ze.valueOf : void 0;
function ou(e) {
  return Re ? Object(Re.call(e)) : {};
}
var iu = ou, su = Se;
function lu(e, t) {
  var n = t ? su(e.buffer) : e.buffer;
  return new e.constructor(n, e.byteOffset, e.length);
}
var uu = lu, cu = Se, pu = tu, du = ru, fu = iu, vu = uu, gu = "[object Boolean]", mu = "[object Date]", yu = "[object Map]", bu = "[object Number]", hu = "[object RegExp]", _u = "[object Set]", $u = "[object String]", wu = "[object Symbol]", Iu = "[object ArrayBuffer]", Cu = "[object DataView]", Au = "[object Float32Array]", Tu = "[object Float64Array]", Su = "[object Int8Array]", Eu = "[object Int16Array]", ju = "[object Int32Array]", Vu = "[object Uint8Array]", Ou = "[object Uint8ClampedArray]", Bu = "[object Uint16Array]", Pu = "[object Uint32Array]";
function Mu(e, t, n) {
  var a = e.constructor;
  switch (t) {
    case Iu:
      return cu(e);
    case gu:
    case mu:
      return new a(+e);
    case Cu:
      return pu(e, n);
    case Au:
    case Tu:
    case Su:
    case Eu:
    case ju:
    case Vu:
    case Ou:
    case Bu:
    case Pu:
      return vu(e, n);
    case yu:
      return new a();
    case bu:
    case $u:
      return new a(e);
    case hu:
      return du(e);
    case _u:
      return new a();
    case wu:
      return fu(e);
  }
}
var Uu = Mu, Gu = W, Ye = Object.create, Lu = function() {
  function e() {
  }
  return function(t) {
    if (!Gu(t))
      return {};
    if (Ye)
      return Ye(t);
    e.prototype = t;
    var n = new e();
    return e.prototype = void 0, n;
  };
}(), zu = Lu, Du = zu, Ku = At, ku = we;
function Fu(e) {
  return typeof e.constructor == "function" && !ku(e) ? Du(Ku(e)) : {};
}
var Nu = Fu, Hu = Te, Wu = X, Xu = "[object Map]";
function Zu(e) {
  return Wu(e) && Hu(e) == Xu;
}
var Ru = Zu, Yu = Ru, xu = _e, xe = $e, Je = xe && xe.isMap, Ju = Je ? xu(Je) : Yu, Qu = Ju, qu = Te, ec = X, tc = "[object Set]";
function nc(e) {
  return ec(e) && qu(e) == tc;
}
var ac = nc, rc = ac, oc = _e, Qe = $e, qe = Qe && Qe.isSet, ic = qe ? oc(qe) : rc, sc = ic, lc = Co, uc = To, cc = mt, pc = bs, dc = Us, fc = Gs, vc = zs, gc = xs, mc = ul, yc = yl, bc = wl, hc = Te, _c = Rl, $c = Uu, wc = Nu, Ic = he, Cc = bt, Ac = Qu, Tc = W, Sc = sc, Ec = Ie, jc = Ce, Vc = 1, Oc = 2, Bc = 4, jt = "[object Arguments]", Pc = "[object Array]", Mc = "[object Boolean]", Uc = "[object Date]", Gc = "[object Error]", Vt = "[object Function]", Lc = "[object GeneratorFunction]", zc = "[object Map]", Dc = "[object Number]", Ot = "[object Object]", Kc = "[object RegExp]", kc = "[object Set]", Fc = "[object String]", Nc = "[object Symbol]", Hc = "[object WeakMap]", Wc = "[object ArrayBuffer]", Xc = "[object DataView]", Zc = "[object Float32Array]", Rc = "[object Float64Array]", Yc = "[object Int8Array]", xc = "[object Int16Array]", Jc = "[object Int32Array]", Qc = "[object Uint8Array]", qc = "[object Uint8ClampedArray]", ep = "[object Uint16Array]", tp = "[object Uint32Array]", y = {};
y[jt] = y[Pc] = y[Wc] = y[Xc] = y[Mc] = y[Uc] = y[Zc] = y[Rc] = y[Yc] = y[xc] = y[Jc] = y[zc] = y[Dc] = y[Ot] = y[Kc] = y[kc] = y[Fc] = y[Nc] = y[Qc] = y[qc] = y[ep] = y[tp] = !0;
y[Gc] = y[Vt] = y[Hc] = !1;
function J(e, t, n, a, r, l) {
  var o, i = t & Vc, u = t & Oc, p = t & Bc;
  if (n && (o = r ? n(e, a, r, l) : n(e)), o !== void 0)
    return o;
  if (!Tc(e))
    return e;
  var m = Ic(e);
  if (m) {
    if (o = _c(e), !i)
      return vc(e, o);
  } else {
    var v = hc(e), d = v == Vt || v == Lc;
    if (Cc(e))
      return fc(e, i);
    if (v == Ot || v == jt || d && !r) {
      if (o = u || d ? {} : wc(e), !i)
        return u ? mc(e, dc(o, e)) : gc(e, pc(o, e));
    } else {
      if (!y[v])
        return r ? e : {};
      o = $c(e, v, i);
    }
  }
  l || (l = new lc());
  var C = l.get(e);
  if (C)
    return C;
  l.set(e, o), Sc(e) ? e.forEach(function(A) {
    o.add(J(A, t, n, A, e, l));
  }) : Ac(e) && e.forEach(function(A, f) {
    o.set(f, J(A, t, n, f, e, l));
  });
  var $ = p ? u ? bc : yc : u ? jc : Ec, N = m ? void 0 : $(e);
  return uc(N || e, function(A, f) {
    N && (f = A, A = e[f]), cc(o, f, J(A, t, n, f, e, l));
  }), o;
}
var np = J, ap = np, rp = 1, op = 4;
function ip(e) {
  return ap(e, rp | op);
}
var sp = ip;
const R = /* @__PURE__ */ ut(sp);
const lp = S({
  name: "weighbill-designer",
  components: { Viewport: ln, Panel: Vn },
  props: {
    widgetOptions: {
      type: Array,
      default: () => []
    },
    tempValue: {
      type: Object,
      default: () => ({
        title: "demo",
        width: 750,
        height: 550,
        pageWidth: 750,
        pageHeight: 550,
        tempItems: []
      })
    }
  },
  emits: ["save", "preview"],
  setup(e, { emit: t }) {
    const n = V(), a = O(n), r = I(() => a.state);
    function l() {
      let u = r.value.page;
      t("save", R(u));
    }
    function o() {
      let u = { ...r.value.page };
      t("preview", R(u));
    }
    function i() {
      a.dispatch("designerInit", {
        tempValue: R(e.tempValue),
        options: R(e.widgetOptions)
      });
    }
    return ot(() => {
      i();
    }), {
      saveTemp: l,
      previewTemp: o
    };
  }
}), up = {
  class: "kr-designer",
  "data-theme": "kr-designer"
}, cp = { class: "kr-designer-tool" }, pp = { class: "kr-designer-tool_bar" };
function dp(e, t, n, a, r, l) {
  const o = g("viewport"), i = g("panel"), u = g("el-scrollbar"), p = g("el-button");
  return h(), _("div", up, [
    s(o, { class: "kr-designer-view" }),
    w("div", cp, [
      s(u, { class: "kr-designer-tool_con" }, {
        default: c(() => [
          s(i, { class: "control-panel" })
        ]),
        _: 1
      }),
      w("div", pp, [
        s(p, {
          size: "mini",
          type: "success",
          onClick: e.saveTemp
        }, {
          default: c(() => [
            T("保存")
          ]),
          _: 1
        }, 8, ["onClick"]),
        s(p, {
          size: "mini",
          type: "primary",
          onClick: e.previewTemp
        }, {
          default: c(() => [
            T("预览")
          ]),
          _: 1
        }, 8, ["onClick"])
      ])
    ])
  ]);
}
const et = /* @__PURE__ */ E(lp, [["render", dp]]), ce = "braid-txt", fp = S({
  name: ce,
  setting: {
    type: ce,
    isEdit: !0,
    dragable: !0,
    // 是否可拖拽
    resizable: !0,
    // 尺寸是否可变
    width: 120,
    height: 40,
    left: 50,
    top: 0,
    title: "自定义文本",
    value: "自定义文本",
    defaultValue: "自定义文本",
    name: "",
    style: {
      zIndex: 0,
      FontSize: 9,
      FontColor: "#000000",
      Bold: !1,
      // 1代表粗体，0代表非粗体
      Italic: !1,
      // 1代表斜体，0代表非斜体
      Underline: !1,
      // 1代表有下划线，0代表无下划线
      Alignment: "left",
      // 对齐方式
      ItemType: 0
      // 打印类型 0--普通项 1--页眉页脚 2--页号项 3--页数项 4--多页项
    }
  },
  props: [
    "val"
    // 文本对象
  ],
  setup(e, { emit: t }) {
    return {
      WIDGET_NAME: ce,
      updateText: (a, r) => {
        let l = a.target.innerHTML;
        console.log(a, l), l != null && t("change", l, r);
      }
    };
  }
}), vp = ["innerHTML", "contenteditable"];
function gp(e, t, n, a, r, l) {
  return h(), _("div", {
    class: "widgets",
    innerHTML: e.val.value,
    contenteditable: !!e.val.isEdit,
    onBlur: t[0] || (t[0] = (o) => e.updateText(o, e.val.uuid)),
    style: B({
      position: "absolute",
      left: e.val.left + "px",
      top: e.val.top + "px",
      width: e.val.width + "px",
      minHeight: e.val.height + "px",
      zIndex: e.val.style.zIndex,
      fontSize: e.val.style.FontSize + "pt",
      color: e.val.style.FontColor,
      textAlign: e.val.style.Alignment,
      fontWeight: e.val.style.Bold ? "bold" : "normal"
    })
  }, null, 44, vp);
}
const te = /* @__PURE__ */ E(fp, [["render", gp]]);
const pe = "bar-code", mp = S({
  name: pe,
  setting: {
    type: pe,
    isEdit: !1,
    dragable: !0,
    // 是否可拖拽
    resizable: !0,
    // 尺寸是否可变
    width: 120,
    height: 40,
    left: 50,
    top: 0,
    title: "条码",
    value: "1234567890",
    defaultValue: "1234567890",
    name: "",
    style: {
      zIndex: 0,
      FontSize: 9,
      ShowBarText: !1,
      // 条码是否显示值 0--不显示 1--显示
      codeType: "Code39",
      // 条码类型
      ItemType: 0
      // 打印类型 0--普通项 1--页眉页脚 2--页号项 3--页数项 4--多页项
    }
  },
  props: ["val"],
  setup() {
    return {
      WIDGET_NAME: pe,
      codeUrl: ""
    };
  }
}), yp = ["src"];
function bp(e, t, n, a, r, l) {
  return h(), _("div", {
    class: "bar-code",
    style: B({
      position: "absolute",
      width: e.val.width + "px",
      height: e.val.height + "px",
      left: e.val.left + "px",
      top: e.val.top + "px",
      zIndex: e.val.zIndex
    })
  }, [
    w("img", { src: e.codeUrl }, null, 8, yp),
    w("div", {
      class: "text",
      style: B({
        display: e.val.style.ShowBarText ? "" : "none",
        fontSize: e.val.style.FontSize + "pt",
        fontWeight: e.val.style.Bold ? "bold" : "normal"
      })
    }, " 1234567890 ", 4)
  ], 4);
}
const ne = /* @__PURE__ */ E(mp, [["render", bp]]), hp = function(e) {
  e.component(te.name, te), e.component(ne.name, ne);
}, _p = function() {
  return {
    [te.name]: te.setting,
    [ne.name]: ne.setting
    // [table.name]: table.setting,
    // [image.name]: image.setting,
    // [html.name]: html.setting,
  };
}, Bt = {
  install: hp,
  getWidgetsSetting: _p
};
function tt(e, t) {
  return typeof t == "function" ? t : e[t];
}
function Pt(e) {
  return Array.isArray(e) ? e.map((t) => ({ k: t, v: t })) : Object.keys(e).map((t) => ({ k: t, v: e[t] }));
}
const $p = (e) => (t) => {
  const n = {}, a = Pt(t);
  e || (e = O(V));
  for (const r in a) {
    let l = a[r];
    n[r] = function() {
      return typeof l == "function" ? l.call(this, e.state) : e.state[l];
    };
  }
  return n;
}, nt = (e, t, n) => (a) => {
  const r = {}, l = Pt(a);
  n || (n = O(V));
  for (const o in l) {
    let i = l[o];
    r[o] = function(u) {
      const p = n[e], m = n[t], v = typeof i == "function" ? i.call(this, p) : i;
      return m.call(n, v, u);
    };
  }
  return r;
};
class wp {
  constructor({
    state: t,
    mutations: n = {},
    actions: a = {},
    plugins: r,
    subscribers: l = []
  } = {}) {
    this.vm = Dt({
      data: {
        $$state: typeof t == "function" ? t() : t
      }
    }), this.mutations = n, this.actions = a, this.subscribers = l, r && r.forEach((o) => this.use(o)), this.mapState = $p(this), this.mapActions = nt("actions", "dispatch", this), this.mapMutations = nt("mutations", "commit", this);
  }
  get state() {
    return this.vm.data.$$state;
  }
  set state(t) {
    if (process.env.NODE_ENV === "development")
      throw new Error(
        "[puex] store.state is read-only, use store.replaceState(state) instead"
      );
  }
  $emit(t, ...n) {
    return this.vm.$emit(t, ...n);
  }
  $on(t, n) {
    return this.vm.$on(t, n);
  }
  subscribe(t) {
    return this.subscribers.push(t), () => this.subscribers.splice(this.subscribers.indexOf(t), 1);
  }
  commit(t, n) {
    this.subscribers.forEach((r) => r({ type: t, payload: n }, this.state));
    const a = tt(this.mutations, t);
    return a && a(this.state, n);
  }
  dispatch(t, n) {
    const a = tt(this.actions, t), r = {
      state: this.state,
      dispatch: this.dispatch.bind(this),
      commit: this.commit.bind(this),
      store: this
    };
    return Promise.resolve(a && a(r, n));
  }
  use(t) {
    return t(this), this;
  }
  replaceState(t) {
    return this.vm.$data.$$state = t, this;
  }
}
const Ip = {
  zoom: 100,
  // 画布缩放百分比
  type: "page",
  // 选中元素类型
  index: -1,
  // 选中元素索引
  uuid: -1,
  // 选中元素uuid
  originX: 0,
  // 选中元件的横向初始值
  originY: 0,
  // 选中元件的纵向初始值
  startX: 0,
  // 鼠标摁下时的横坐标
  startY: 0,
  // 鼠标摁下时的纵坐标
  moving: !1,
  // 是否正在移动元件（参考线仅在移动元件时显示）
  activeElement: x(),
  // 选中对象，要么是元件，要么是页面
  // 模板信息
  page: {
    title: "demo",
    width: 750,
    height: 550,
    pageWidth: 750,
    pageHeight: 550,
    tempItems: []
    // 模板已选项
  },
  optionItems: [],
  // 可选项
  //模板参数
  tempId: "",
  // 模板Id
  loading: !1,
  // 是否正在初始化中
  widgetSetting: Bt.getWidgetsSetting()
  // 模板组件默认属性
}, Cp = {
  // 添加模板项
  addTempItem({ state: e, commit: t }, n) {
    t("addTempItem", n), t("select", {
      uuid: e.page.tempItems[e.page.tempItems.length - 1].uuid
    });
  },
  // 初始化模板设计器
  async designerInit({ state: e, commit: t }, n) {
    console.log(n.options), t("initOptionItems", n.options), t("initPage", n.tempValue);
  }
};
var Ap = self.crypto || self.msCrypto, Tp = function(e) {
  return Ap.getRandomValues(new Uint8Array(e));
}, Sp = function(e, t, n) {
  for (var a = (2 << Math.log(t.length - 1) / Math.LN2) - 1, r = Math.ceil(1.6 * a * n / t.length), l = ""; ; )
    for (var o = e(r), i = 0; i < r; i++) {
      var u = o[i] & a;
      if (t[u] && (l += t[u], l.length === n))
        return l;
    }
}, Ep = Tp, jp = Sp, Vp = function(e, t) {
  return jp(Ep, e, t);
};
const Op = /* @__PURE__ */ ut(Vp), Bp = {
  // 初始化页面属性
  initPage(e, t) {
    e.page = t;
    let n = t.tempItems ? t.tempItems.map((a) => ({
      ...e.widgetSetting[a.type],
      ...a,
      style: {
        ...e.widgetSetting[a.type].style,
        ...a.style || {}
      }
    })) : [];
    e.page.tempItems = n;
  },
  // 初始化可选对象
  initOptionItems(e, t) {
    let n = t ? t.map((a) => ({
      ...e.widgetSetting[a.type],
      ...a,
      style: {
        ...e.widgetSetting[a.type].style,
        ...a.style || {}
      }
    })) : [];
    e.optionItems = n;
  },
  // 初始化选中对象
  initActive(e) {
    e.activeElement = x();
  },
  // 设置 mousemove 操作的初始值
  initmove(e, t) {
    e.startX = t.startX, e.startY = t.startY, e.originX = t.originX, e.originY = t.originY, e.moving = !0;
  },
  // 选中元件与取消选中
  select(e, t) {
    if (e.uuid = t.uuid, t.uuid === -1)
      e.activeElement = x(), e.type = "page";
    else {
      let n = e.page.tempItems.find((a) => a.uuid === t.uuid);
      n && (e.activeElement = n, e.type = n.type);
    }
  },
  // 元件移动结束
  stopmove(e) {
    e.moving = !1;
  },
  // 移动元件
  move(e, t) {
    var n = e.activeElement, a = t.x - e.startX, r = t.y - e.startY, l = e.originX + Math.floor(a * 100 / e.zoom), o = e.originY + Math.floor(r * 100 / e.zoom);
    n.left = l > 0 ? l : 0, n.top = o > 0 ? o : 0;
  },
  // 调整元件尺寸
  resize(e, t) {
    var n = t.x - e.startX, a = t.y - e.startY, r;
    if (t.type === "right") {
      r = e.originX + Math.floor(n * 100 / e.zoom), e.activeElement.width = r > 10 ? r : 10;
      return;
    }
    if (t.type === "down") {
      r = e.originX + Math.floor(a * 100 / e.zoom), e.activeElement.height = r > 10 ? r : 10;
      return;
    }
    if (t.type === "left") {
      var l = e.originX + Math.floor(n * 100 / e.zoom), o = e.originY - Math.floor(n * 100 / e.zoom);
      e.activeElement.left = l > 0 ? l : 0, e.activeElement.width = o > 10 ? o : 10;
      return;
    }
    if (t.type === "up") {
      var i = e.originX + Math.floor(a * 100 / e.zoom), u = e.originY - Math.floor(a * 100 / e.zoom);
      e.activeElement.top = i > 0 ? i : 0, e.activeElement.height = u > 10 ? u : 10;
    }
  },
  // 更新元件初始 top 值
  updateSrollTop(e, t) {
    e.top = t;
  },
  // 页面缩放
  zoom(e, t) {
    e.zoom = t;
  },
  // 删除选中元件
  delete(e, t) {
    var n = e.type;
    if (n === "page")
      return;
    let a = 0;
    e.page.tempItems.forEach((r, l) => {
      r.uuid === t && (a = l);
    }), e.page.tempItems.splice(a, 1), e.activeElement = x(), e.type = "page", e.uuid = -1;
  },
  // 添加组件
  addTempItem(e, t) {
    let n = { uuid: Op("1234567890abcdef", 10) }, a = JSON.parse(JSON.stringify(t));
    e.page.tempItems.push(Object.assign(a, n));
  },
  // 更新数据
  updateData(e, { uuid: t, value: n }) {
    let a = e.page.tempItems.find((r) => r.uuid === t);
    a && (a.value = n);
  },
  // 设置模板Id
  setTempId(e, t) {
    e.tempId = t;
  },
  setLoading(e, t) {
    e.loading = t;
  },
  // 设置模板默认属性
  setWidgetSetting(e, t) {
    e.widgetSetting = t;
  }
}, at = new wp({
  state: Ip,
  actions: Cp,
  mutations: Bp
});
console.log(Wt, it);
const Pp = new URL("data:application/javascript;base64,aW1wb3J0IHsgaW5pdEN1c3RvbUZvcm1hdHRlciwgd2FybiB9IGZyb20gJ0B2dWUvcnVudGltZS1kb20nOwpleHBvcnQgKiBmcm9tICdAdnVlL3J1bnRpbWUtZG9tJzsKCmZ1bmN0aW9uIGluaXREZXYoKSB7CiAgewogICAgaW5pdEN1c3RvbUZvcm1hdHRlcigpOwogIH0KfQoKaWYgKCEhKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSAicHJvZHVjdGlvbiIpKSB7CiAgaW5pdERldigpOwp9CmNvbnN0IGNvbXBpbGUgPSAoKSA9PiB7CiAgaWYgKCEhKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSAicHJvZHVjdGlvbiIpKSB7CiAgICB3YXJuKAogICAgICBgUnVudGltZSBjb21waWxhdGlvbiBpcyBub3Qgc3VwcG9ydGVkIGluIHRoaXMgYnVpbGQgb2YgVnVlLmAgKyAoYCBDb25maWd1cmUgeW91ciBidW5kbGVyIHRvIGFsaWFzICJ2dWUiIHRvICJ2dWUvZGlzdC92dWUuZXNtLWJ1bmRsZXIuanMiLmAgKQogICAgICAvKiBzaG91bGQgbm90IGhhcHBlbiAqLwogICAgKTsKICB9Cn07CgpleHBvcnQgeyBjb21waWxlIH07Cg==", self.location);
console.log("Vue 模块 URL:", Pp.href);
const Mp = new URL("data:application/javascript;base64,aW1wb3J0ICogYXMgVnVlIGZyb20gJ3Z1ZScKCnZhciBpc1Z1ZTIgPSBmYWxzZQp2YXIgaXNWdWUzID0gdHJ1ZQp2YXIgVnVlMiA9IHVuZGVmaW5lZAoKZnVuY3Rpb24gaW5zdGFsbCgpIHt9CgpleHBvcnQgZnVuY3Rpb24gc2V0KHRhcmdldCwga2V5LCB2YWwpIHsKICBpZiAoQXJyYXkuaXNBcnJheSh0YXJnZXQpKSB7CiAgICB0YXJnZXQubGVuZ3RoID0gTWF0aC5tYXgodGFyZ2V0Lmxlbmd0aCwga2V5KQogICAgdGFyZ2V0LnNwbGljZShrZXksIDEsIHZhbCkKICAgIHJldHVybiB2YWwKICB9CiAgdGFyZ2V0W2tleV0gPSB2YWwKICByZXR1cm4gdmFsCn0KCmV4cG9ydCBmdW5jdGlvbiBkZWwodGFyZ2V0LCBrZXkpIHsKICBpZiAoQXJyYXkuaXNBcnJheSh0YXJnZXQpKSB7CiAgICB0YXJnZXQuc3BsaWNlKGtleSwgMSkKICAgIHJldHVybgogIH0KICBkZWxldGUgdGFyZ2V0W2tleV0KfQoKZXhwb3J0ICogZnJvbSAndnVlJwpleHBvcnQgewogIFZ1ZSwKICBWdWUyLAogIGlzVnVlMiwKICBpc1Z1ZTMsCiAgaW5zdGFsbCwKfQo=", self.location);
console.log("VueDemi 模块 URL:", Mp.href);
const Mt = (e) => {
  if (console.log(st, lt, it, e.version), console.log("Running in", "Vue 3", "environment"), e.version.startsWith("2")) {
    const n = e;
    n.component("weighbill-designer", et), n.prototype.$vptd = at;
  } else {
    const n = e;
    n.component("weighbill-designer", et), n.config.globalProperties.$vptd = at;
  }
  e.use(Bt);
};
typeof window < "u" && window.Vue && Mt(createApp());
const Gp = {
  install: Mt
};
export {
  et as Designer,
  Gp as default,
  Mt as install
};
